package com.mynovamobile.android;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

public class Preload extends Activity {
	private final static String TAG = "[Preloader]";
	private MNMUserDefaults userData;

	@Override 
	public void onCreate(Bundle savedInstanceState) {
		Log.v(TAG, "Called onCreate");
		super.onCreate(savedInstanceState);
		setContentView(R.layout.splash);
		userData = MNMUserDefaults.getInstance(this);	
		
		if (userData.contains("MNM_UID")) {
			Log.v(TAG, "User is registered");
			startActivity(new Intent(getApplicationContext(), PinLogin.class));
		} else {
			Log.v(TAG, "User is not registered");
			startActivity(new Intent(getApplicationContext(), LDAPLogin.class));
		}
	}
	
	@Override 
	public void onPause() {
		Log.v(TAG, "Called onPause");
		super.onPause();
		finish();
	}
}
